package com.example.filesftp.job;


import com.example.filesftp.ftptransfer.service.FileSftpService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class FileTransferJob implements Job {

    @Autowired
    private FileSftpService fileSftpService;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        String configId = context.getJobDetail().getJobDataMap().getString("configId");
        fileSftpService.triggerJob(configId);
    }
}